home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 2.9 KB | 74 lines | [TEXT/MPS ] |
- (* Some Unix system calls. *)
-
- exception OS_error of int;;
- (* Raised by some functions in the unix and io modules, when
- the underlying system call fails. The argument to OS_error
- is the Unix error code (errno). See intro(2). *)
-
- value command_line : string vect
- (* The command line arguments given to the process. *)
- ;;
-
- type file_stat =
- { st_dev: int; (* st_dev --- device number *)
- st_ino: int; (* st_ino --- inode number *)
- st_mode: int; (* st_mode --- access rights *)
- st_nlink: int; (* st_nlink --- number of hard links *)
- st_uid: int; (* st_uid --- user id of owner *)
- st_gid: int; (* st_gid --- group id of owner *)
- st_rdev: int; (* st_rdev --- device type *)
- st_size: int; (* st_size --- total size, in bytes *)
- st_atime: int; (* st_atime --- date of last access *)
- st_mtime: int; (* st_mtime --- date of last modification *)
- st_ctime: int; (* st_ctime --- date of last status change *)
- st_blksize: int; (* st_blksize --- optimal buffer size *)
- st_blocks: int } (* st_blocks --- number of blocks used *)
- ;;
-
- type times =
- { tms_real: float; (* real time *)
- tms_utime: float; (* tms_utime - process user time *)
- tms_stime: float; (* tms_stime - process system time *)
- tms_cutime: float; (* tms_cutime - children user time *)
- tms_cstime: float } (* tms_cstime - children system time *)
- ;;
-
- (* See the corresponding man pages in section 2. *)
-
- value exit : int -> 'a = 1 "unix_exit"
- and open : string -> int -> int -> int = 3 "unix_open"
- and close : int -> int = 1 "unix_close"
- and read : int -> string -> int -> int -> int = 4 "unix_read"
- and write : int -> string -> int -> int -> int = 4 "unix_write"
- and lseek : int -> int -> int -> int = 3 "unix_lseek"
- and truncate : string -> int -> int = 2 "unix_truncate"
- and stat : string -> file_stat = 1 "unix_stat" "alloc"
- and fstat : int -> file_stat = 1 "unix_fstat" "alloc"
- and link : string -> string -> int = 2 "unix_link"
- and unlink : string -> int = 1 "unix_unlink"
- and pipe : unit -> int * int = 1 "unix_pipe" "alloc"
- and times : unit -> times = 1 "unix_times" "alloc"
- and fork : unit -> int = 1 "unix_fork"
- and execv : string -> string vect -> unit = 2 "unix_execv"
- and os_errno : unit -> int = 1 "os_errno"
- and os_error_message : int -> string = 1 "os_error_message" "alloc"
- ;;
-
- (* Open modes and rights. See open(2). *)
-
- value mode_rdonly : int
- and mode_wronly : int
- and mode_rdwr : int
- and mode_creat : int
- and mode_trunc : int
- and mode_excl : int
- and rights_read : int
- and rights_write : int
- and rights_exec : int
- and rights_owner : int
- and rights_group : int
- and rights_others : int
- and rights_everything : int
- and rights_everybody : int
- ;;
-